<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>垫款单详情</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div id="pageInTab" class="pageInTab">
        <div tabid="tabA" title="基本信息" lselected="true">
            <form id="formSet1">
                <div class="fieldset1 tabel_col clearFix">
                    <div class="caption">
                        <span class="title">基本信息</span>
                    </div>
                    <div class="fieldBox col_33">
                        <div class="label">垫款单名称</div>
                        <div class="field">
                            <span name="billNm" id="billNm">&nbsp;</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33">
                        <div class="label">垫款规则名称</div>
                        <div class="field">
                            <span name="ruleNm" id="ruleNm">&nbsp;</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33">
                        <div class="label">再融资项目名称</div>
                        <div class="field">
                            <span name="refPrjNm" id="refPrjNm">&nbsp;</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33">
                        <div class="label">状态</div>
                        <div class="field">
                            <span name="billStsCd" id="billStsCd">&nbsp;</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33">
                        <div class="label">创建人</div>
                        <div class="field">
                            <span name="crtUsrNm" id="crtUsrNm">&nbsp;</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33">
                        <div class="label">创建时间</div>
                        <div class="field">
                            <span name="crtTm" id="crtTm">&nbsp;</span>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>


<script type="text/javascript">
    var extData;
    var loadedTabs = [];
    $(function () {
        initData();
        $("#formSet1").ligerForm();
    });

    function initData() {
        var id = ${id};
        if (!id) return;
        var _url = '<%=path%>/dk/dkbillinfo/getById.do';
        $.ajax({
            type: 'get',
            dataType: 'json',
            data: {id: id},
            url: _url,
            success: function (msg) {
                if (msg.success == 1) {
                    setData(msg.data);//设置数据
                    extData = msg.data;
                } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });
    }

    //设置页面数据
    function setData(data) {
        var form = liger.get("formSet1");

        $("#billNm").html(data.billNm);
        $("#ruleNm").html(data.ruleNm);
        $("#refPrjNm").html(data.refPrjNm);
        //状态
        if (data.billStsCd == 1) {
            $("#billStsCd").html("垫款中");
        } else if (data.billStsCd == 0) {
            $("#billStsCd").html("结束");
        }
        $("#crtUsrNm").html(data.crtUsrNm);
        //日期处理
        if (data.crtTm) {
            var date = new Date(data.crtTm);
            var dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
            $("#crtTm").html(dateStr);
        }

    };

</script>


</body>
</html>
